package com.mhc.haval.manager;

import com.mhc.haval.dal.model.FuncDO;
import com.mhc.haval.dal.model.RoleDO;
import com.subaru.common.query.PageResult;
import com.mhc.haval.dal.model.StaffDO;
import com.mhc.haval.dal.query.StaffQuery;

import java.util.List;
import java.util.Map;


/**
 * Manager for Staff.
 */
public interface StaffManager {
    /**
     * query count by query condition.
     */
    int countByQuery(StaffQuery query);

    /**
     * delete by query condition.
     */
    int deleteByQuery(StaffQuery query);

    /**
     * delete by primary key.
     */
    int deleteByPrimaryKey(StaffDO record);

    /**
     * insert selective.
     */
    long insertSelective(StaffDO record);

    /**
     * select by query condition.
     */
    List<StaffDO> selectByQuery(StaffQuery query);


    /**
     * select by query condition with page.
     */
    PageResult<StaffDO> selectByQueryWithPage(StaffQuery query);

    /**
     * select by primary key.
     */
    StaffDO selectByPrimaryKey(Long id);

    /**
     * select by staff phone.
     */
    StaffDO selectByStaffPhone(String staffPhone);

    /**
     * update by query condition selective.
     */
    int updateByQuerySelective( StaffDO record,  StaffQuery query);

    /**
     * update by query condition.
     */
    int updateByQuery(StaffDO record, StaffQuery query);

    /**
     * update by primary key selective.
     */
    int updateByPrimaryKeySelective(StaffDO record);

    /**
     * 获取用户拥有的角色
     */
    List<RoleDO> selectRoleListByStaffPhone(String staffPhone);

    /**
     * 获取用户拥有的功能
     */
    List<FuncDO> selectFuncListByStaffPhone(String staffPhone);

    /**
     * 根据角色id获取对应的员工列表
     * @param queryMap
     * @return
     */
    List<StaffDO> selectStaffListByRoleCode(Map queryMap);
}